{% extends "common/list.html" %}
{% load i18n humanize %}
{% block list_row %}
			<tr class="{% cycle 'row1' 'row2' %}">
				<td class="noline" colspan="2"><b>{{object.title|escape}}</b></td>
			</tr>
			<tr class="{% cycle 'row1' 'row2' %}" >
				<td colspan="2">{{object.created_by}} @ {{object.created|naturalday}}{% if object.update %}/{{object.updated_by}} @ {{object.updated|naturalday}}{%endif%}</td>
			</tr>
			<tr class="{% cycle 'row1' 'row2' %}" >
				<td class="noline" colspan="2">{{ object.text|escape|linebreaks }}</td>
			</tr>
			<tr class="{% cycle 'row1' 'row2' %}" >
                <td class="noline"><a href="{% url sample.views.post_edit key=object.id %}">{% trans "edit" %}</a></td>
                <td class="noline"><a href="{% url sample.views.post_delete key=object.id %}">{% trans "delete" %}</a></td>
			</tr>
{% endblock %}

{% block form %}
    <div class="form">
        <form action="{% url sample.views.post_create %}" method="post">
            {% csrf_token %}
            <input type="hidden" name="key" value="{{key}}"/>
            <div>{% trans "Title:" %}<input type="text" name="post_title" value="{{post_title}}"/></div>
            <div>{% trans "Text:" %}<textarea name="post_text">{{post_text}}</textarea></div>
            <div><input type="submit" value="{% trans 'Submit' %}"/></div>
        </form>
    </div>
{% endblock form %}
